<%--
  Created by IntelliJ IDEA.
  User: lenovo
  Date: 2016/9/8
  Time: 15:32
  To change this template use File | Settings | File Templates.
--%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<%@taglib prefix="s" uri="http://www.springframework.org/tags" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <title>Title</title>
    <script src="../js/jquery/jquery-1.8.0.min.js"></script>
    <link rel="stylesheet" type="text/css" href="../js/semanticUI/dist/semantic.min.css">
    <script src="../js/semanticUI/dist/semantic.min.js"></script>
    <script src="../js/jw/jw.js"></script>
    <script type="application/javascript">
        function doDownload(id) {
            window.location = "./downloadSingleBizAttachment?atype=${param.type}&aid=" + id;
        }
        function doDownloadAll(bid) {
            window.location = "./downloadBizAttachment?type=${param.type}&bid=" + bid;
        }
    </script>
</head>
<body>
<table class="ui celled striped table">
    <thead>
    <tr>
        <th colspan="5">
            <script type="text/javascript">
                if ('${bid}') {
                    document.write("文件下载");
                    document.write(
                            '<div class="ui button" style="float: right;"onclick="doDownloadAll(\'${bid}\');">');
                    document.write("一键下载");
                    document.write("</div>");
                }
            </script>
        </th>
    </tr>
    </thead>
    <tbody>
    <tr>
        <td class="center aligned">序号</td>
        <td class="center aligned">文件名称</td>
        <td class="center aligned">上传时间</td>
        <td class="center aligned">操作</td>
    </tr>
    <c:forEach var="attachment" items="${attachmentList}" varStatus="i">
        <tr>
            <td>${i.index+1}</td>
            <td>
                <i class="file outline icon"></i> ${attachment.name}
            </td>
            <td>${attachment.ctime}</td>
            <td><a href="javascript:;" onclick="javascript:doDownload('${attachment.id}');">下载</a>
            </td>
        </tr>
    </c:forEach>
    </tbody>
</table>
</body>
</html>
